



function User() {}
User.prototype.show = function() {
	console.log(this.description());
};

function Admin() {}
// Admin.prototype = Object.create(User.prototype);
Admin.prototype.showAdmin = function() {
	return "管理员在此";
};
Admin.prototype.show = function() {
	return "管理员在此 Admin";
};

function Member() {}
// Member.prototype = Object.create(User.prototype);
Member.prototype.showMember = function() {
	return "我是会员";
};
Member.prototype.show  = function() {
	return "我是会员 Member";
};

function Enterprise() {}
// Enterprise.prototype = Object.create(User.prototype);
Enterprise.prototype.showEnterprise = function() {
	return "企业帐户";
};
Enterprise.prototype.show = function() {
	return "企业帐户 Show";
};
for (const obj of [new Admin(), new Member(), new Enterprise()]) {
	if (obj instanceof Admin) {
		console.log(obj.showAdmin());
	} else if (obj instanceof Member) {
		console.log(obj.showMember());
	} else if (obj instanceof Enterprise) {
		console.log(obj.showEnterprise());
	}

	// 多态， 不用判断实例到底是什么类型， 不同类型的实例，表现出不同的形态
	console.log(obj.show())
	
}